import Vue from "vue";
import App from "./App.vue";
import ElementUI from "element-ui";
import "normalize.css/normalize.css";
import "element-ui/lib/theme-chalk/index.css";
import "./assets/theme/index.scss";
import "./assets/css/index.scss";
var moment = require("moment");
Vue.config.productionTip = false;
Vue.use(ElementUI);
/** 时间戳转换
 * @method $moment
 * @param {time：时间戳，format：转换格式}
 */
Vue.prototype.$moment = function (
  str,
  type = "YYYY-MM-DD HH:mm:ss",
  filter = false
) {
  if (filter) {
    if (str) {
      return moment(parseInt(str)).format(type);
    } else {
      return "-";
    }
  } else {
    return str;
  }
};

new Vue({
  render: (h) => h(App),
}).$mount("#app");
